<template>
  <el-container class="home-container">
    <el-aside width="200px"><NavigationBar> </NavigationBar></el-aside>

    <el-container>
      <el-header>
        <span class="hint">欢迎您,普通管理员：</span>
        <strong class="hint">{{username}}</strong>
        <button class="hints">退出</button>
      </el-header>
      <el-main>
        <TheBreadCrumb></TheBreadCrumb>
        <keep-alive>
          <router-view v-if="$route.meta.isKeepAlive"></router-view>
        </keep-alive>
        <router-view v-if="!$route.meta.isKeepAlive"></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import NavigationBar from "@/components/navigation bar/NavigationBar.vue";
import TheBreadCrumb from "@/components/the-breadcrumb/TheBreadCrumb.vue";
export default {
  components: {
    NavigationBar,
    TheBreadCrumb,
  },
  computed:{
    username(){
      return this.$store.state.userInfo.username
    }
  }
};
</script>

<style>
.home-container {
  min-height: 100vh;
}

.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: right;
  line-height: 60px;
}
.hints {
  margin: 0px 30px;
  background-color: blue;
  color: white;
  border-radius: 5px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
